<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--禁用-->
<input type="text" placeholder="提示" abc="abc" disabled>
<button type="button">点击</button>
<div>
    <span>1</span>
</div>
<script>
    let input = document.querySelector("input");
    console.log(input.type);
    console.log(input.placeholder);
    console.log(input.getAttribute("type"));
    console.log(input["type"]);
    setTimeout(function () {
        //没有如果则添加
        // input.setAttribute("placeholder", "这是修改过的");
    }, 1000);
    console.log("----------------------------------")
    //删除一个属性
    delete input.placeholder;//删除失败
    console.log(input.placeholder);
    let obj = {
        name: "a"
    }
    console.log(obj.name);
    delete obj.name;//删除自定义的Object中的属性
    console.log(obj.name);

    input.removeAttribute("placeholder");
    console.log(input.placeholder);
    console.log(input);

    console.log("----------------------------------")
    input.setAttribute("haha", "1");
    console.log(input.getAttribute("haha"));
    console.log(input.haha);
    console.log(input["haha"]);
    console.log(input);

    console.log(input.getAttribute("abc"));
    console.log(input.abc);
    console.log(input["abc"]);

    console.log(input.hasAttribute("abc"));
    console.log(input.getAttributeNames());
    //qualifiedName: string, force?: boolean
    //force，true，就是添加，false，删除属性
    // input.toggleAttribute("ee");
    // console.log(input);
    // input.toggleAttribute("ee");
    // console.log(input);

    document.querySelector("button").onclick = function (e) {
        input.toggleAttribute("disabled");
        console.log(input);
    }

    let div = document.querySelector("div");
    document.getElementById()

</script>
</body>
</html>